// 获取列表 /api/videoList
import videos from '~/database/videos.json'

export default defineEventHandler((event) => {
  const query = getQuery(event)
  const channelId = query.channelId ? Number(query.channelId) : null
  console.log(typeof channelId,'==========q========')

  if (!!channelId) {
    return videos.filter(item => item.channel === channelId)
  }else{
    return videos
  }


  // 过滤
  // const query = getRouterQuery(event)
  // const channelId = query.channelId
  // if (channelId) {
  //   videos = videos.filter(item => item.channelId === Number(channelId))
  // }

})



